﻿using System.Linq;
using BankCreditPortfolio.DAL.Entities;

namespace BankCreditPortfolio.DAL.Services
{
    public class BankerService : DataService<Banker>
    {
        public Banker GetByEmail(string email)
        {
            var filteredQuery = this.CreateQuery().Where(x => x.Account.Email == email);
            return filteredQuery.Count() > 0 ? filteredQuery.Single() : null;
        }
    }
}